package com.hbnu.innerclass;

/**
 * @author kittychen
 * @since 2025-09-17 17:37
 */
public class InnerClassDemo01 {

    private String username;

    public void method01() {
        InnerClass01 innerClass01 = new InnerClass01();   // 内部类对象
        System.out.println("外部类中访问内部类中的成员属性gender：" + innerClass01.gender);
        innerClass01.method02();
        System.out.println(InnerClass02.username);
    }

    // 内部类
    public class InnerClass01 {

        private static String gender;

        public void method02() {
            System.out.println("内部类中访问外部类中的成员属性username：" + username);
            method01();
        }

        public static void method01() {
            System.out.println("");
        }
    }

    // 静态成员内部类
    public static class InnerClass02 {
        private static String username;
    }
}
